/*
 * RDFStylizer.java
 * 
 * Copyright (c) 2009 Barraquand Remi <dev at barraquand.com>. All rights reserved.
 * 
 * This file is part of JenaTools
 * 
 * JenaTools is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * JenaTools is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with JenaTools.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.barraquand.labs.jenatools;

import com.hp.hpl.jena.rdf.model.InfModel;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.reasoner.Reasoner;
import com.hp.hpl.jena.reasoner.rulesys.GenericRuleReasonerFactory;
import com.hp.hpl.jena.util.PrintUtil;

/**
 *
 * @author Barraquand Remi
 */
public class RDFStylizer {
    
    Reasoner  reasoner;

    public RDFStylizer(Resource configuration) {
        PrintUtil.registerPrefix(GSS.getPrefix(), GSS.getURI());
        reasoner = GenericRuleReasonerFactory.theInstance().create(configuration);
    }



    public InfModel applyStyleToModel(Model m) {
        InfModel infmodel = ModelFactory.createInfModel(reasoner, m);
        infmodel.write(System.out);
        return infmodel;
    }
}
